/**
 * @file {公共的表映射关系}
 */
const { DataTypes } = require('../../azeroth').sequelize;

const jobInitData = [
    {
        uid: {
            field: 'uid',
            type: DataTypes.BIGINT(11),
            allowNull: false,
            primaryKey: true,
            autoIncrement: true
        },
        job_name: {
            field: 'job_name',
            type: DataTypes.STRING,
        },
        panel_sum: {
            field: 'panel_sum',
            type: DataTypes.INTEGER
        },
        ok_number: {
            field: 'ok_number',
            type: DataTypes.INTEGER
        },
        ng_number: {
            field: 'ng_number',
            type: DataTypes.INTEGER
        },
        start_time: {
            field: 'start_time',
            type: DataTypes.BIGINT
        },
        finish_time: {
            field: 'finish_time',
            type: DataTypes.BIGINT
        },
        start_time_str: {
            field: 'start_time_str',
            type: DataTypes.STRING
        },
        finish_time_str: {
            field: 'finish_time_str',
            type: DataTypes.STRING
        }
    }
]

const flawInitData = [
    {
        uid: {
            field: 'uid',
            type: DataTypes.INTEGER,
            allowNull: false,
            primaryKey: true,
            autoIncrement: true,
        },
        job_id: {
            field: 'job_id',
            type: DataTypes.INTEGER,
        },
        panel_id: {
            field: 'panel_id',
            type: DataTypes.STRING,
        },
        class_id: {
            field: 'class_id',
            type: DataTypes.INTEGER,
        },
        center_pos_md: {
            field: 'center_pos_md',
            type: DataTypes.INTEGER,
        },
        center_pos_cd: {
            field: 'center_pos_cd',
            type: DataTypes.INTEGER,
        },
        length_md: {
            field: 'length_md',
            type: DataTypes.INTEGER,
        },
        length_cd: {
            field: 'length_cd',
            type: DataTypes.INTEGER,
        },
        contours: {
            field: 'contours',
            type: DataTypes.STRING,
        },
        gen_time: {
            field: 'gen_time',
            type: DataTypes.BIGINT,
        },
        gen_time_str: {
            field: 'gen_time_str',
            type: DataTypes.STRING,
        },
        save_path: {
            field: 'save_path',
            type: DataTypes.STRING,
        },
        ui_show_text: {
            field: 'ui_show_text',
            type: DataTypes.STRING,
        },
        area: {
            field: 'area',
            type: DataTypes.INTEGER,
        },
        diameter: {
            field: 'diameter',
            type: DataTypes.INTEGER,
        },
        camera_id: {
            field: 'camera_id',
            type: DataTypes.INTEGER,
        },
        flaw_class_type: {
            field: 'flaw_class_type',
            type: DataTypes.STRING,
        },
        lot_id: {
            field: 'lot_id',
            type: DataTypes.STRING,
        }
    },
]

const panelInitData = [
    {
        uid: {
            field: 'uid',
            type: DataTypes.INTEGER,
            allowNull: false,
            primaryKey: true,
            autoIncrement: true
        },
        job_id: {
            field: 'job_id',
            type: DataTypes.INTEGER,
            allowNull: false,
            primaryKey: true,
            autoIncrement: false
        },
        panel_id: {
            field: 'panel_id',
            type: DataTypes.STRING
        },
        flaw_count: {
            field: 'flaw_count',
            type: DataTypes.INTEGER
        },
        is_ok: {
            field: 'is_ok',
            type: DataTypes.INTEGER
        },
        length_md: {
            field: 'length_md',
            type: DataTypes.INTEGER
        },
        length_cd: {
            field: 'length_cd',
            type: DataTypes.INTEGER
        },
        save_path: {
            field: 'save_path',
            type: DataTypes.STRING
        },
        gen_time: {
            field: 'gen_time',
            type: DataTypes.BIGINT
        },
        gen_time_str: {
            field: 'gen_time_str',
            type: DataTypes.STRING
        },
        detectParam: {
            field: 'detectParam',
            type: DataTypes.TEXT
        },
        checked: {
            field: 'checked',
            type: DataTypes.INTEGER
        },
    },
]

const flawFilterInitData = [
    {
        id: {
            field: 'id',
            type: DataTypes.BIGINT(11),
            allowNull: false,
            primaryKey: true,
            autoIncrement: true,
        },
        panel_id: {
            field: 'panel_id',
            type: DataTypes.STRING,
        },
        panel_table_uid: {
            field: 'panel_table_uid',
            type: DataTypes.INTEGER,
        },
        flowClassType: {
            field: 'flowClassType',
            type: DataTypes.INTEGER,
        },
        device_id: {
            field: 'device_id',
            type: DataTypes.STRING,
        },
        show: {
            field: 'show',
            type: DataTypes.STRING,
        },
        flaw_count: {
            field: 'flaw_count',
            type: DataTypes.INTEGER,
        },
        symbol: {
            field: 'symbol',
            type: DataTypes.STRING,
        },
        color: {
            field: 'color',
            type: DataTypes.STRING,
        }
    }
]

module.exports = {
    jobInitData,
    flawInitData,
    panelInitData,
    flawFilterInitData
}